//
//	GDTtDevicesDto.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "GDTtDevicesDto.h"

NSString *const kGDTtDevicesDtoBleState = @"bleState";
NSString *const kGDTtDevicesDtoBoxSoc = @"boxSoc";
NSString *const kGDTtDevicesDtoChargedStatus = @"chargedStatus";
NSString *const kGDTtDevicesDtoDeviceId = @"deviceId";
NSString *const kGDTtDevicesDtoDeviceName = @"deviceName";
NSString *const kGDTtDevicesDtoDeviceTemp = @"deviceTemp";
NSString *const kGDTtDevicesDtoIdField = @"id";
NSString *const kGDTtDevicesDtoMacAddress = @"macAddress";
NSString *const kGDTtDevicesDtoReportDataTime = @"reportDataTime";
NSString *const kGDTtDevicesDtoTempSoc = @"tempSoc";
NSString *const kGDTtDevicesDtoTempStatus = @"tempStatus";

@interface GDTtDevicesDto ()
@end
@implementation GDTtDevicesDto




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kGDTtDevicesDtoBleState] isKindOfClass:[NSNull class]]){
		self.bleState = [dictionary[kGDTtDevicesDtoBleState] integerValue];
	}

	if(![dictionary[kGDTtDevicesDtoBoxSoc] isKindOfClass:[NSNull class]]){
		self.boxSoc = [dictionary[kGDTtDevicesDtoBoxSoc] integerValue];
	}

	if(![dictionary[kGDTtDevicesDtoChargedStatus] isKindOfClass:[NSNull class]]){
		self.chargedStatus = [dictionary[kGDTtDevicesDtoChargedStatus] integerValue];
	}

	if(![dictionary[kGDTtDevicesDtoDeviceId] isKindOfClass:[NSNull class]]){
		self.deviceId = dictionary[kGDTtDevicesDtoDeviceId];
	}	
	if(![dictionary[kGDTtDevicesDtoDeviceName] isKindOfClass:[NSNull class]]){
		self.deviceName = dictionary[kGDTtDevicesDtoDeviceName];
	}	
	if(![dictionary[kGDTtDevicesDtoDeviceTemp] isKindOfClass:[NSNull class]]){
		self.deviceTemp = [dictionary[kGDTtDevicesDtoDeviceTemp] floatValue];
	}

	if(![dictionary[kGDTtDevicesDtoIdField] isKindOfClass:[NSNull class]]){
		self.idField = dictionary[kGDTtDevicesDtoIdField];
	}	
	if(![dictionary[kGDTtDevicesDtoMacAddress] isKindOfClass:[NSNull class]]){
		self.macAddress = dictionary[kGDTtDevicesDtoMacAddress];
	}	
	if(![dictionary[kGDTtDevicesDtoReportDataTime] isKindOfClass:[NSNull class]]){
		self.reportDataTime = dictionary[kGDTtDevicesDtoReportDataTime];
	}	
	if(![dictionary[kGDTtDevicesDtoTempSoc] isKindOfClass:[NSNull class]]){
		self.tempSoc = [dictionary[kGDTtDevicesDtoTempSoc] integerValue];
	}

	if(![dictionary[kGDTtDevicesDtoTempStatus] isKindOfClass:[NSNull class]]){
		self.tempStatus = [dictionary[kGDTtDevicesDtoTempStatus] integerValue];
	}

	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	dictionary[kGDTtDevicesDtoBleState] = @(self.bleState);
	dictionary[kGDTtDevicesDtoBoxSoc] = @(self.boxSoc);
	dictionary[kGDTtDevicesDtoChargedStatus] = @(self.chargedStatus);
	if(self.deviceId != nil){
		dictionary[kGDTtDevicesDtoDeviceId] = self.deviceId;
	}
	if(self.deviceName != nil){
		dictionary[kGDTtDevicesDtoDeviceName] = self.deviceName;
	}
	dictionary[kGDTtDevicesDtoDeviceTemp] = @(self.deviceTemp);
	if(self.idField != nil){
		dictionary[kGDTtDevicesDtoIdField] = self.idField;
	}
	if(self.macAddress != nil){
		dictionary[kGDTtDevicesDtoMacAddress] = self.macAddress;
	}
	if(self.reportDataTime != nil){
		dictionary[kGDTtDevicesDtoReportDataTime] = self.reportDataTime;
	}
	dictionary[kGDTtDevicesDtoTempSoc] = @(self.tempSoc);
	dictionary[kGDTtDevicesDtoTempStatus] = @(self.tempStatus);
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	[aCoder encodeObject:@(self.bleState) forKey:kGDTtDevicesDtoBleState];	[aCoder encodeObject:@(self.boxSoc) forKey:kGDTtDevicesDtoBoxSoc];	[aCoder encodeObject:@(self.chargedStatus) forKey:kGDTtDevicesDtoChargedStatus];	if(self.deviceId != nil){
		[aCoder encodeObject:self.deviceId forKey:kGDTtDevicesDtoDeviceId];
	}
	if(self.deviceName != nil){
		[aCoder encodeObject:self.deviceName forKey:kGDTtDevicesDtoDeviceName];
	}
	[aCoder encodeObject:@(self.deviceTemp) forKey:kGDTtDevicesDtoDeviceTemp];	if(self.idField != nil){
		[aCoder encodeObject:self.idField forKey:kGDTtDevicesDtoIdField];
	}
	if(self.macAddress != nil){
		[aCoder encodeObject:self.macAddress forKey:kGDTtDevicesDtoMacAddress];
	}
	if(self.reportDataTime != nil){
		[aCoder encodeObject:self.reportDataTime forKey:kGDTtDevicesDtoReportDataTime];
	}
	[aCoder encodeObject:@(self.tempSoc) forKey:kGDTtDevicesDtoTempSoc];	[aCoder encodeObject:@(self.tempStatus) forKey:kGDTtDevicesDtoTempStatus];
}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.bleState = [[aDecoder decodeObjectForKey:kGDTtDevicesDtoBleState] integerValue];
	self.boxSoc = [[aDecoder decodeObjectForKey:kGDTtDevicesDtoBoxSoc] integerValue];
	self.chargedStatus = [[aDecoder decodeObjectForKey:kGDTtDevicesDtoChargedStatus] integerValue];
	self.deviceId = [aDecoder decodeObjectForKey:kGDTtDevicesDtoDeviceId];
	self.deviceName = [aDecoder decodeObjectForKey:kGDTtDevicesDtoDeviceName];
	self.deviceTemp = [[aDecoder decodeObjectForKey:kGDTtDevicesDtoDeviceTemp] floatValue];
	self.idField = [aDecoder decodeObjectForKey:kGDTtDevicesDtoIdField];
	self.macAddress = [aDecoder decodeObjectForKey:kGDTtDevicesDtoMacAddress];
	self.reportDataTime = [aDecoder decodeObjectForKey:kGDTtDevicesDtoReportDataTime];
	self.tempSoc = [[aDecoder decodeObjectForKey:kGDTtDevicesDtoTempSoc] integerValue];
	self.tempStatus = [[aDecoder decodeObjectForKey:kGDTtDevicesDtoTempStatus] integerValue];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	GDTtDevicesDto *copy = [GDTtDevicesDto new];

	copy.bleState = self.bleState;
	copy.boxSoc = self.boxSoc;
	copy.chargedStatus = self.chargedStatus;
	copy.deviceId = [self.deviceId copy];
	copy.deviceName = [self.deviceName copy];
	copy.deviceTemp = self.deviceTemp;
	copy.idField = [self.idField copy];
	copy.macAddress = [self.macAddress copy];
	copy.reportDataTime = [self.reportDataTime copy];
	copy.tempSoc = self.tempSoc;
	copy.tempStatus = self.tempStatus;

	return copy;
}
@end